//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: table_so.c 757 2007-05-10 08:19:31Z roger $
//

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <SWTable.h>
#include <unihan_im.h>

#include <stdio.h>

#include "im_config.h"
#include "candidates.h"
#include "context.h"
#include "table.h"

int
unihan_im_module_init(void)
{
#if DEBUG
	fprintf(stderr, "table: unihan_im_module_init()\n");
#endif
	//FIXME : get all desktop exist.
	return TRUE;
}

void
unihan_im_module_done(void)
{
#if DEBUG
	fprintf(stderr, "table: unihan_im_module_done()\n");
#endif
	return;
}

int
unihan_im_module_get_info(UnihanIMModuleArgList *args)
{
#if DEBUG
	fprintf(stderr, "table: unihan_im_module_get_info()\n");
#endif

	if (!args) return FALSE;
	while (args->id) {
		switch (args->id) {
			case UNIHAN_IM_MODULE_ID:
				args->value = (void *)strdup("table");
				break;
			case UNIHAN_IM_MODULE_NAME:
				args->value = (void *)strdup("Generic Table");
				break;
			case UNIHAN_IM_MODULE_VERSION:
				args->value = (void *)strdup("1.0");
				break;
			case UNIHAN_IM_MODULE_IM_LIST:
				args->value = (void *)table_get_im_list();
				break;
                        case UNIHAN_IM_API_VERSION:
                                args->value = (void *)strdup("1.0");
                                break;
		}
		++args;
	}

	return TRUE;
}

// vi:ts=4:nowrap:cin:expandtab
